set srcsolndir=X:\svn\Emlyn.Applications.Console.VersionNumberAdder Solution
set solndir=X:\svnbin\Emlyn.Applications.Console.VersionNumberAdder Solution
set vernamefolder=X:\svnbin\Emlyn.Applications.Console.VersionNumberAdder Solution\Emlyn.Applications.Console.VersionNumberAdder\bin\Release

mkdir "%solndir%\DeployTemp"

del /Q "%solndir%\DeployTemp\*.*"

copy "%solndir%\VersionNumberAdder Installer\bin\Release\VersionNumberAdder Installer.msi" "%solndir%\DeployTemp\VersionNumberAdder v#vernum#.msi" 

"%vernamefolder%\vername.exe" "%solndir%\DeployTemp\VersionNumberAdder v#vernum#.msi" "%solndir%\Emlyn.Applications.Console.VersionNumberAdder\bin\Release\vername.exe"

rmdir /S /Q "%solndir%\DeployTemp\source"
mkdir "%solndir%\DeployTemp\source"

xcopy "%srcsolndir%\Emlyn.Applications.Console.VersionNumberAdder" "%solndir%\DeployTemp\source\Emlyn.Applications.Console.VersionNumberAdder" /S /E /I

rmdir /S /Q "%solndir%\DeployTemp\source\Emlyn.Applications.Console.VersionNumberAdder\obj"

xcopy "%srcsolndir%\VersionNumberAdder Installer" "%solndir%\DeployTemp\source\VersionNumberAdder Installer" /S /E /I

xcopy "%srcsolndir%\Emlyn.Applications.Console.VersionNumberAdder Solution.sln" "%solndir%\DeployTemp\source"

"C:\Program Files\7-Zip\7z.exe" a -r -tzip "%solndir%\DeployTemp\VersionNumberAdder v#vernum#.zip" "%solndir%\DeployTemp\*"

"%vernamefolder%\vername.exe" "%solndir%\DeployTemp\VersionNumberAdder v#vernum#.zip" "%solndir%\Emlyn.Applications.Console.VersionNumberAdder\bin\Release\vername.exe"

ftp -s:ftpdeploy.txt -i
